package com.hydl.power.mapper;


import com.hydl.power.pojo.Device;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

public interface DeviceMapper {

    int deleteById(Integer id);

    int insertInto(Device record);

    Device selectById(Integer id);

    int updateDeviceById(Device record);

    List<Device> getAllDevice(@Param("pageNumKey") Integer pageNum, @Param("pageSizeKey") Integer pageSize,@Param("projectId")  String projectId);

    /**
     * 实时监测 告警设置查询
     * @param pageNum
     * @param pageSize
     * @param areaId
     * @param navId
     * @param powerRoomId
     * @param deviceId
     * @return
     */
    List<Device> getAllDeviceById(@Param("pageNumKey") Integer pageNum, @Param("pageSizeKey") Integer pageSize,
                                  @Param("areaId") String areaId,@Param("navId") String navId,
                                  @Param("powerRoomId") String powerRoomId,@Param("deviceId") String deviceId);

    Device selectBydeviceId(String deviceId);

    Device selectByserialNumber(String serialNumber);

    List<Device> selectByRoomId(String roomId);

    Integer queryPowerPage(String projectId);

    /*查询所有设备*/
    List<Device> getAll(@Param("pageNumKey") Integer pageNum, @Param("pageSizeKey") Integer pageSize);

    List<Device> getAll();

    List<Device> queryByCondition(@Param("pageNumKey") Integer pageNum, @Param("pageSizeKey") Integer pageSize,String cityId,String projectId,String roomId,String gatewaySn);

    List<Device> queryByToken(@Param("pageNumKey") Integer pageNum, @Param("pageSizeKey") Integer pageSize,String cityId,String projectId,String roomId,String gatewaySn,String token);



    String selectSnBydeviceId(String deviceId);

    List<String> selectSnList();


    List<Device> queryDevice(String roomId);

    Device getDeviceByDeviceId(@Param("deviceId")String deviceId);

    List<Device> getDeviceByPowerRoomId(String powerRoomId);

    Device getAllDeviceByDeviceName(String deviceName);

    Device selectAllBySn(String gatewaySn);

    /*模糊查询*/
    List<Device> queryDeviceLike(@Param("pageNumKey") Integer pageNum, @Param("pageSizeKey") Integer pageSize,String text,String projectId);
    /*查询进线柜*/
    List<Device> queryByDeviceIdLike(String roomId);

    int selectCountByRoomId(String roomId);

    String getDeviceNumberByRoomId(String roomId);

    List<Device> getDeviceByGatewaySn(String gatewaySn);

    String getDeviceNumberByProjectId(String projectId);

    void updateDeviceAlarmByDeviceId(String deviceId, Integer alarm,Integer communicationStatus);

    List<Device> getDeviceAllByGatewaySn(String gatewaySn);

    List<Device> getDeviceByProjectId(String projectId);

    List<Device> getDeviceTransformerStatus(String projectId);

    List<Device> getDeviceAllByGatewaySnAlarmStatus(String gatewaySn);

    List<Device> queryTypeId(String projectId,Integer typeId);

    int queryTransformer(String projectId);

    Device getDeviceBySerialNumber(String serialNumber);

    List<String> getDeviceId(String projectId);
}
